<%@ page language="java" import="java.util.*" pageEncoding="utf-8"
	isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>

<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/locale/easyui-lang-zh_CN.js"></script>
<link href="<%=request.getContextPath()%>/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/jPages.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/animate.css">
<style>
.tablelist thead{
	top:0;
	left:0;
}
</style>
<script src="<%=request.getContextPath()%>/js/jquery-1.8.2.min.js"></script>
<script src="<%=request.getContextPath()%>/js/jPages.js"></script>
<script type="text/javascript">
$(function(){  
	$("div.holder").jPages({  
	  containerID : "item", 
	  first:"首页", 
	  previous : "上一页",  
	  next : "下一页",
	  last:"尾页",  
	  perPage : 10,  
	  //delay : 100,
	  //动画效果
	  //animation:"bounceInLeft"
	});  
 });  
</script>
<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
 	 $(".tip").fadeIn(200);
  });
  
  $(".sure").click(function(){
 	 $(".tip").fadeOut(100);
  });

  $(".cancel").click(function(){
	  $(".tip").fadeOut(100);
	  $(".jiefeng").fadeOut(100);
  });
  
});
</script>
<style>
	/* .zi{
	    background: url(../images/toolbg.gif) repeat-x;
	    line-height: 15px;
	    height: 33px;
	    text-align: center;
	} */
	.toolbar1 table{
	    width: 100%;
	}
	.toolbar1 tr input, select{
	    width: 93px;
	}
</style>
</head>

<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><ema href="javascript:void">首页</em></li>
			<li><ema href="javascript:void">财务管理</em></li>
			<li><ema href="javascript:void">收支统计</em></li>
		</ul>
	</div>
	<div class="rightinfo">
		<div class="tools">
			<form action="<%=request.getContextPath()%>/selectIncomeList" method="post" name="serch">
		<%-- 	<strong style="font-size:25px;">平台总收入：￥${sumMoney}</strong> --%>
<!-- 				<td class="zi">提现时间：</td> -->
<!-- 				<td><input type="date" name="startTime" style="border:1px solid #d7a372;"/>至<input type="date" name="endTime" style="border:1px solid #d7a372;"/></td> -->
			<ul class="toolbar">
				<li class="exportExcel"><span><img src="<%=request.getContextPath()%>/images/t04.png" /></span>导出</li>
<%-- 				<li class="backups"><span><img src="<%=request.getContextPath()%>/images/t01.png" /></span>备份</li>
							<li class="recovery"><span><img src="<%=request.getContextPath()%>/images/t02.png" /></span>恢复</li>
 --%>			</ul>
			<div class="toolbar1">
				<table>
					<tr>
					<td class="zi"><span>服务地点</span></td>
						<td><input type="text" placeholder="请输入服务地点" name="serveraddres"/></td>
						<td class="zi"><span>支付方式</span></td>
						<td><select name="payType">
								<option selected="selected" value="">请选择</option>
								<option value="钱包">钱包</option>
								<option value="微信">微信</option>
								<option value="支付宝">支付宝</option>
						</select></td>
						<td class="zi"><span>会员类型</span></td>
						<td><select name="userType">
								<option selected="selected" value="">请选择</option>
								<option value="0">普通会员</option>
								<option value="1">vip1</option>
								<option value="3">vip2</option>
								<option value="2">企业vip</option>
						</select></td>
						<td class="zi"><span>订单号</span></td>
						<td><input type="text" placeholder="请输入订单号" name="orderId"/></td>
							<td class="zi" ><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;服务类型：</span></td>
								<td><select name="serverName" class="selector">
								<option selected="selected" value="">请选择服务类型</option>
								<option value="劳务">劳务</option>
								<option value="咨询">咨询</option>
								<option value="陪护">陪护</option>
						</select></td>
							<td class="zi"><span>服务子类型</span></td>
						<td>
						<select name="serverType" class="selector">
								<option selected="selected" value="">请选择服务子类型</option>
									<c:forEach items="${listd}" var="l">
										<option value="${l.server_sub_name }">${l.server_sub_name }</option>
									</c:forEach>
						</select>
						
						<td class="zi"><span>往来类型</span></td>
						<td><select name="type">
								<option selected="selected" value="">请选择分类</option>
								<option value="完成">完成</option>
								<option value="需方违约支出">需方违约支出</option>
								<option value="服务方违约金收入">服务方违约金收入</option>
								<option value="服务违约支出">服务违约支出</option>
								<option value="需方违约收入">需方违约收入</option>
								<option value="预付返还">预付返还</option>
								<option value="预约预付">预约预付</option>
								<option value="充值余额">充值余额</option>
								<option value="会员">会员</option>
								<option value="提现">提现</option>
						</select></td>
						<!-- <td class="zi"><span>订单类型</span></td>
						<td><select name="type">
								<option selected="selected" value="">请选择分类</option>
								<option value="1">服务</option>
								<option value="2">充值</option>
								<option value="3">会员</option>
								<option value="4">已取消</option>
								<option value="5">提现不通过</option>
						</select></td>
						<td class="zi"><span>用户等级</span></td>
						<td><select name="integral_rank">
								<option selected="selected" value="">请选择分类</option>
								<option value="普通会员">普通会员</option>
								<option value="铜牌会员">铜牌会员</option>
								<option value="银牌会员">银牌会员</option>
								<option value="金牌会员">金牌会员</option>
						</select></td>
						<td class="zi"><span>用户等级</span></td>
						<td><select name="integral_rank">
								<option selected="selected" value="">请选择分类</option>
								<option value="普通会员">普通会员</option>
								<option value="铜牌会员">铜牌会员</option>
								<option value="银牌会员">银牌会员</option>
								<option value="金牌会员">金牌会员</option>
						</select></td> -->
						<td class="zi" ><span>用户手机</span></td>
						<td><input type="text" placeholder="请输入用户手机号" name="mobile"/></td>
						<td class="zi"><span>交易日期：</span></td>
						<td><input type="date" name="startTime" />至<input type="date" name="endTime" /></td>
						<td><input type="submit" value="查询" class="button" /></td>
					</tr>
				</table>
			</div>
			</form>
		</div>
		<table class="tablelist">
			<thead>
			<!-- 	<tr>
					<th>交易日期</th>
					<th>订单编号</th>
					<th>昵称</th>
					<th>手机号</th>
					<th>用户等级</th>
					<th>服务类型</th>
					<th>金额</th>
					<th>优惠券</th>
					<th>积分抵现</th>
					<th>VIP折扣</th>
					<th>实际付款</th>
					<th>打赏小费</th>
					<th>支付方式</th>
					<th>到期时间</th>
					<th>类型</th>
					<th>平台收入</th>
					<th>手续费(按服务金额)</th>
				</tr> -->
				<tr>
					<th>交易日期</th>
					<th>订单编号</th>
					<th>昵称</th>
					<th>手机号</th>
					<th>用户等级</th>
					<th>会员类型</th>
					<th>服务地点</th>
					<th>服务类型</th>
					<th>服务子类型</th>
					<th>服务时间</th>
					<th>服务单位</th>
					<th>单价</th>
					<th>订单金额</th>
					<th>用户余额</th>
					<th>优惠券</th>
					<th>积分抵现</th>
					<th>VIP折扣</th>
					<th>实付款</th>
					<th>打赏</th>
					<th>支付方式</th>
					<th>VIP到期时间</th>
					<th>往来类型</th>
					<th>平台收支</th>
					<th>平台余额</th>
					<th>手续费(按服务金额)</th>
				</tr>
			</thead>
			<tbody class="tb" id="item">
				<c:forEach items="${lists}" var="data">
			<%-- 		<tr>
						<td>${data.create_time}</td>
						<td>${data.order_id}</td>
 						<td>${data.username}</td>
						<td>${data.mobile}</td>
						<td>${data.integral_rank}</td>
						<td>${data.server_sub_type}</td>
						<td>￥${data.sum_price}</td>
						<td>￥${data.coupon}</td>
						<td>￥${data.integral}</td>
						<td>￥${data.vip_discount}</td>
						<td>￥${data.reality_price}</td>
						<td>
							<c:if test="${data.give_reward == null}">￥0</c:if>
							<c:if test="${data.give_reward != null}">￥${data.give_reward}</c:if>
						</td>
						<input type="hidden" value="${data.id}"/>
						<td>${data.type}</td>
						<td>${data.expire_time}</td>
						<td>${data.orderType}</td>
						<td>${data.platform}</td>
						<td>${data.service_charge}</td>
					</tr> --%>
					<tr>
						<td>${data.create_time}</td>
						<td>${data.order_id}</td>
 						<td>${data.username}</td>
						<td>${data.mobile}</td>
						<td>
						   ${data.integral_rank}
						</td>
						<td>
										<c:if test="${data.vipId == 1}">VIP1</c:if>
							<c:if test="${data.vipId == 2}">企业VIP</c:if>
							<c:if test="${data.vipId == 3}">VIP2</c:if>
							<c:if test="${data.vipId == null}">普通用户</c:if>
						</td>
							<td>
						    ${data.server_address}
						</td>
							<td>
						    ${data.server_type}
						</td>
						<td>
						  <c:choose>   
                             <c:when test="${data.server_sub_type != null}">
                                   ${data.server_sub_type}
                             </c:when>  
                             <c:when test="${data.server_sub_type == null and data.txType == 1}">
                                                                                        银行卡提现
                             </c:when>  
                             <c:when test="${data.server_sub_type == null and data.txType == 2}">
                                                                                        支付宝提现
                             </c:when>   
                          </c:choose>
						</td>
					<td>
						    ${data.server_time}
						</td>
						<td>
						    ${data.company_name}
						</td>
						<td>
						    ${data.price}
						</td>
						<td>
						  	<c:choose>   
                                 <c:when test="${data.orderMoney != null}">
                                        ${data.orderMoney}
                                 </c:when>  
                                 <c:when test="${data.orderMoney == null and data.selectType == '提现成功'}">
                                         ${data.realityPrice}
                                 </c:when>  
                                <c:otherwise>
                                        0.0
                                </c:otherwise>  
                            </c:choose>  
						</td>
						<td>
						  	<c:choose>  
                                 <c:when test="${data.user_id != 1}">
                                        ${data.user_money}
                                 </c:when>  
                                <c:otherwise>
                                        0.0
                                </c:otherwise>  
                            </c:choose>  
						</td>
						<td>￥${data.coupon== null ?'0.0' : data.coupon}</td>
						<td>￥${data.integral== null ?'0.0' : data.integral}</td>
						<td>￥${data.vip_discount== null ?'0.0' : data.vip_discount}</td>
						<td>￥${data.realityPrice}</td>
						<td>
							<c:if test="${data.give_reward == null}">￥0</c:if>
							<c:if test="${data.give_reward != null}">￥${data.give_reward}</c:if>
						</td>
						<input type="hidden" value="${data.id}"/>
						<td>
							<c:choose>  
                                 <c:when test="${data.coupon != null and data.coupon != '0.0' and data.coupon != '0' and data.integral != null and data.integral != '0'}">
                                        ${data.zfType}+优惠券+积分
                                 </c:when>  
                                 <c:when test="${data.coupon != null and data.coupon != '0.0' and data.coupon != '0'} ">
                                        ${data.zfType}+优惠券
                                 </c:when>  
                                 <c:when test="${data.integral != null and data.integral != '0'}">
                                        ${data.zfType}+积分
                                 </c:when>  
                                 <c:when test="${data.selectType == '提现成功'}">
                                                                                                    钱包
                                 </c:when>  
                                <c:otherwise>
                                        ${data.zfType}
                                </c:otherwise>  
                            </c:choose>  
						</td>
						<%-- <td>${data.zfType}</td> --%>
						<td>${data.expire_time}</td>
						<td>${data.selectType}</td>
						
						<%-- <td>
						   <c:choose>  
                                 <c:when test="${data.selectType !='' or data.selectType!= null}">
                                        ${data.selectType}
                                 </c:when>   
                                <c:otherwise>
                                       ${data.txType}
                                </c:otherwise>
                            </c:choose> 
						</td> --%>
						<td>
						     <c:choose>  
                                 <c:when test="${data.selectType=='预约预付' or data.selectType=='充值余额' or data.selectType=='会员'}">
                                        ${data.szMoney}
                                 </c:when>   
                                 <c:when test="${ data.selectType=='需方违约支出'  or data.selectType=='服务违约支出'  or data.selectType=='需方违约收入'  or data.selectType=='服务方违约金收入' or data.selectType=='提现失败(后台审核失败)'}">
                                         ${data.szMoney}
                                 </c:when> 
                                <c:otherwise>
                                       -${data.szMoney}
                                </c:otherwise> 
                            </c:choose> 
						</td>
						<td>
					<%-- 	 <c:choose>   
                              <c:when test="${data.selectType=='提现成功' or data.selectType=='需方违约支出'  or data.selectType=='服务违约支出'  or data.selectType=='需方违约收入'  or data.selectType=='服务方违约金收入' or data.selectType=='提现失败(后台审核失败)'}">
                                      ${data.szMoney}
                             </c:when>   
                             <c:otherwise> --%>
                                  ${data.platform_money}
                          <%--    </c:otherwise> 
                          </c:choose> --%>
						</td>
						<td>	 
						  <c:choose>   
                             <c:when test="${data.procedure_money != null}">
                                   ${data.procedure_money}
                             </c:when>  
                             <c:when test="${data.procedure_money == null}">
                                   0.0
                             </c:when>  
                          </c:choose>
                        </td>
					</tr> 
				</c:forEach>
			</tbody>
		</table>
		<div style="clear:both;"></div>
		<!-- 分页的页码 -->
		<div class="holder"></div>
		共${nums}条记录
		<div class="tip">
			<div class="tiptop">
				<span>提示信息</span>
			</div>
			<div class="tipinfo">
				<span><img src="<%=request.getContextPath()%>/images/ticon.png" /></span>
				<div class="tipright">
					<p>是否确认封号 ？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>
			<div class="tipbtn">
				<input name="" type="button" class="sure" value="确定"/>&nbsp;<input name="" type="button" class="cancel" value="取消" />
			</div>
		</div>
		
		<div class="jiefeng" style="width:485px; height:260px; position:absolute;top:10%; left:30%;background:#fcfdfd;box-shadow:1px 8px 10px 1px #9b9b9b;border-radius:1px;behavior:url(js/pie.htc); display:none; z-index:111111;">
			<div class="tiptop">
				<span>提示信息</span>
			</div>
			<div class="tipinfo">
				<span><img src="<%=request.getContextPath()%>/images/ticon.png" /></span>
				<div class="tipright">
					<p>是否确认解封 ？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>
			<div class="tipbtn">
				<input name="" type="button" class="sure" value="确定"/>&nbsp;<input name="" type="button" class="cancel" value="取消" />
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$('.tablelist tbody tr:odd').addClass('odd');
		  function update(a){
			  var text = $(a).text();
			  var statu = "";
			  if(text == "封号"){
				  $(".tip").fadeIn(500);
				  statu = "0";
			  }else if(text == "解封"){
				  $(".jiefeng").fadeIn(500);
				  statu = "1";
			  }
			  $(".sure").click(function(){
		      	 var params = $(a).parent().parent().find("input[type=hidden]").val() + "," + statu;
		      	 window.location.href="/htx-backer/updateUserStatu?params="+params;
		     });
			  
		  }
		  
		  $(".exportExcel").click(function(){
				 window.location.href = "/htx-backer/incomExportExcel?serveraddres="+ $("input[name=serveraddres]").val()+"&userType="+$("select[name=userType]").val()+"&orderId="+$("input[name=orderId]").val()+"&serverName="+$("select[name='serverName']").val()+"&serverType="+$("select[name=serverType]").val()+"&type="+$("select[name=type]").val()+"&mobile="+$("input[name='mobile']").val()+"&startTime="+$("input[name='startTime']").val()+"&endTime="+$("input[name='endTime']").val()+"&payType="+$("select[name='payType']").val();
			 }) 
		  var scrollThead = $('.tablelist thead');
		  $(window).scroll(function(){
				var scrollTop=$(window).scrollTop();	//获取到scrollTop
				if(scrollTop>157)
				{
					scrollThead.css('position','fixed');
				}
				else
				{
					scrollThead.css('position','');
				}
		  })	
		  
		    $(".backups").click(function(){
		  $.ajax({
  				type:"get",
  				url:"/htx-backer/backups", 
  				data:{
  					name:"cancel_order"
  				},
  				success:function(data){
  					if(data == "OK"){
  					 	alert("备份成功!");
  					}else{
  						alert("备份失败!");
  					}
  					
  				}
			}) 
	 })
	  $(".recovery").click(function(){
		  $.ajax({
  				type:"get",
  				url:"/htx-backer/recovery", 
  				data:{
  					name:"cancel_order"
  				},
  				success:function(data){
  					if(data == "OK"){
  						var btn = confirm("恢复成功,点击确定刷新列表!")
  					 	if(btn == true){
		   					window.location.href="<%=request.getContextPath()%>/selectIncomeList";
  					 	}
  					}else{
  						alert("恢复失败!");
  					}
  				}
			}) 
	 })
	</script>
	
</body>
</html>
